<!-- actions -->
<div class="actions">
	<button type="button" class="btn btn-primary btnPeople">Find People</button>
</div>

<!-- grid -->
<table class="table table-bordered table-hover">
	<thead>
		<tr>
			<th style="width:20px"></th>
			<th style="width:50px">#</th>
			<th>Name</th>
		</tr>
	</thead>

	<?php 
		$data = $model->getResult();
		$items = $data['items'];
		$paging = $data['paging'];
		$i = $paging['offset']+1;
	?>
	<tbody>
	<?php foreach($items as $item): ?>
		<?php $item['no'] = $i; $i++; ?>
		<tr>
		<?php if ($model->type==1): ?>
			<?php $this->renderPartial('search/group', array('item'=>$item)) ?>
		<?php else: ?>
			<?php $this->renderPartial('search/page', array('item'=>$item)) ?>
		<?php endif ?>
		</tr>
	<?php endforeach ?>
	</tbody>

</table>

<!-- paging -->
<ul class="pager" style="margin-bottom: 0">
	<?php if (isset($paging['previous'])): ?>
	<li class="previous"><a href="javascript:void(0)" onclick="loadPage(<?php echo $paging['previous'] ?>)">Previous</a></li>
	<?php endif ?>

	<?php if (isset($paging['next'])): ?>
	<li class="next"><a href="javascript:void(0)" onclick="loadPage(<?php echo $paging['next'] ?>)">Next</a></li>
	<?php endif ?>
</ul>

<script>
//<![CDATA[
$('.btnPeople').click(onBtnPeople);
$('.chkItem').click(onItemClick);
//]]>
</script>

